package com.ruoyi.project.check.service.impl;

import com.ruoyi.project.check.domain.HgCheck;
import com.ruoyi.project.check.mapper.RegCheckMapper;
import com.ruoyi.project.check.service.RgCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RgCheckServiceImpl implements RgCheckService {
    @Autowired
    private RegCheckMapper regCheckMapper;

    @Override
    public List<HgCheck> findById(HgCheck hgCheck) {
        List<HgCheck> hgChecks = regCheckMapper.selectById(hgCheck);

        for (HgCheck h:hgChecks) {
            double count = h.getRcamount()/h.getRcprice();
            h.setCount(count);
        }
        return hgChecks;
    }
}
